package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.validate.IdentifyCode;
import com.ruoyi.system.validate.group.EditData;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

@TableName("my_book")
public class MyBook {

    @TableId(type = IdType.AUTO)
    @Excel(type = Excel.Type.EXPORT,name = "图书编号")
    @NotNull(groups = EditData.class,message = "图书编号不能为空")
    private Integer bookId;

    @Excel(name = "图书名称")
    @NotBlank(message = "请输入图书名称")
    private String bookName;

    @Excel(name = "图书价格",cellType = Excel.ColumnType.NUMERIC)
    @Min(value = 0L,message = "价格必须大于零")
    private Double bookPrice;

    @Excel(name = "图书描述")
    @Size(min = 0,max = 2048,message = "描述长度在0-2048之间")
    private String bookDesc;

    @Excel(name = "图书封面",cellType = Excel.ColumnType.IMAGE)
    private String bookUrl;

    @IdentifyCode
    @TableField(exist = false)
    private String identifyCode;

    @TableField(exist = false)
    private SysUser user;

    private long belongTo;

    private Integer typeId;

    private String evaluateType;

    @TableField(exist = false)
    private List<MySubScribe> subScribeList;

    @Override
    public String toString() {
        return "MyBook{" +
                "bookId=" + bookId +
                ", bookName='" + bookName + '\'' +
                ", bookPrice=" + bookPrice +
                ", bookDesc='" + bookDesc + '\'' +
                '}';
    }

    public String getEvaluateType() {
        return evaluateType;
    }

    public void setEvaluateType(String evaluateType) {
        this.evaluateType = evaluateType;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public List<MySubScribe> getSubScribeList() {
        return subScribeList;
    }

    public void setSubScribeList(List<MySubScribe> subScribeList) {
        this.subScribeList = subScribeList;
    }

    public long getBelongTo() {
        return belongTo;
    }

    public void setBelongTo(long belongTo) {
        this.belongTo = belongTo;
    }


    public SysUser getUser() {
        return user;
    }

    public void setUser(SysUser user) {
        this.user = user;
    }

    public String getIdentifyCode() {
        return identifyCode;
    }

    public void setIdentifyCode(String identifyCode) {
        this.identifyCode = identifyCode;
    }

    public String getBookUrl(){
        return bookUrl;
    }

    public void setBookUrl(String bookUrl) {
        this.bookUrl = bookUrl;
    }

    public Integer getBookId() {
        return bookId;
    }

    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public Double getBookPrice() {
        return bookPrice;
    }

    public void setBookPrice(Double bookPrice) {
        this.bookPrice = bookPrice;
    }

    public String getBookDesc() {
        return bookDesc;
    }

    public void setBookDesc(String bookDesc) {
        this.bookDesc = bookDesc;
    }
}
